/*
 * SwsoException.h
 *
 *  Created on: 20.11.2009
 *      Author: Sergej Schmidt
 *
*/
#ifndef SWSO_EXCEPTION_H_
#define SWSO_EXCEPTION_H_

class SwsoException
{
public:
	std::string m_strMessage;
	SwsoException(std::string message)
	{
		m_strMessage = message;
	}
	SwsoException(std::string message, int linenum)
	{
		m_strMessage = "!" + linenum + message;
	}
	SwsoException(std::string message, char* filename)
	{
		m_strMessage = "!" + message + " in " + filename;
	}
	SwsoException(std::string message, int linenum, char* filename)
	{
		m_strMessage = "!" + linenum + message + " in " + filename;
	}
	SwsoException(std::string message,  char* filename, int linenum)
	{
		m_strMessage = "!" + linenum + message + " in " + filename;
	}

	friend std::ostream& operator << ( std::ostream& s, SwsoException& e)
	{
		s << e.m_strMessage;
		return s;
	}
	friend std::ostream& operator << ( std::ostream& s, SwsoException* e)
	{
		s << (*e).m_strMessage;
		return s;
	}
};
#endif /* SWSO_EXCEPTION_H_ */
